package rejjie.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rejjie.common.R;
import rejjie.entity.Orders;
import rejjie.service.OrderService;

@RestController
@RequestMapping("/order")
public class OrderDetailController {

    @Autowired
    private OrderService orderService;
    /**
     * 下单操作涉及多个表， orders order_deatil表
     * 所以我们需要完善信息，把各个表填充好
     * 最后清空该用户的购物车中的信息
     * @param orders
     * @return
     */
    @RequestMapping("/submit")
    public R<String> sumbit(@RequestBody  Orders orders){
        orderService.submit(orders);
        return R.success("下单成功");
    }
}
